home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / bbs / cuser125.zip / CUCHECK.MEX < prev    next >
Text File  |  1997-07-12  |  14KB  |  559 lines

  1. //////////////////////////////////////////////////////////////////////////////
  2. //                                                                          //
  3. // CoolUser V1.25 (C)1996-1997 Neil Staib  - Checked Part 2                 //
  4. //                                                                          //
  5. // MEX: Copywrite 1990, 1995 by Lanius Corporation. All Rights reserved.    //
  6. //                                                                          //
  7. //////////////////////////////////////////////////////////////////////////////
  8. #include <max.mh>                                                                                                                                                        include <max.mh>                                                           //
  9. #include <intpad.mh>
  10. #define INCL_global
  11. #define INCL_cooluser
  12. #include <language.mh>
  13. #include <cooluser.mh>
  14.  
  15. #ifdef internal_not
  16. #define intnot 0
  17. #else
  18. #define intnot 1
  19. #endif
  20.  
  21. void main()
  22. {
  23.  
  24.   char: inkey, nonstop;
  25.   string: name, inkeys;
  26.   int: nameint, nameco, done, opt, fd;
  27.  
  28.   init_lang_cooluser();
  29.  
  30.   // Read inkey key
  31.  
  32.   fd:=open(str_st_dir_txt + "cucheck.2", IOPEN_READ);
  33.   readln(fd, inkeys);
  34.   close(fd);
  35.   remove(str_st_dir_txt + "cucheck.2");
  36.  
  37.   if (inkeys = "u")  // Hidden from Userlist
  38.       {
  39.         print(str_st_menu_display, 'U');
  40.  
  41.         #ifdef hidden_opt
  42.          {
  43.         log(":COOLUSER: "+ str_st_log_hidden);
  44.  
  45.          if (usr.noulist = 0)
  46.             {
  47.               usr.noulist := 1;
  48.               editoption(20, 34, 21, 34, Bool(usr.noulist), 4, ' ', str_st_data_fields);
  49.               goto getfull;
  50.             }
  51.          if (usr.noulist = 1)
  52.            {
  53.               usr.noulist := 0;
  54.               editoption(20, 34, 21, 34, Bool(usr.noulist), 4, ' ', str_st_data_fields);
  55.               goto getfull;
  56.            }
  57.          }
  58.         #else
  59.          {
  60.          optionbad();
  61.          goto start;
  62.          }
  63.         #endif
  64.       }
  65.  
  66.     if (inkeys = "t")  // AVATAR Mode
  67.       {
  68.         print(str_st_menu_display, 'T');
  69.         #ifdef avatar_opt
  70.          {
  71.         log(":COOLUSER: "+ str_st_log_avatar);
  72.             if (usr.video = 3)
  73.               {
  74.                 usr.video := 1;
  75.                 goto start;
  76.               }
  77.             else
  78.               {
  79.                usr.video :=3;
  80.                goto start;
  81.               }
  82.          }
  83.         #else
  84.           {
  85.            optionbad();
  86.            goto start;
  87.           }
  88.         #endif
  89.       }
  90.  
  91.  
  92.     if (inkeys = "e") // Full Screen Msg Editor
  93.      {
  94.        print(str_st_menu_display, 'E');
  95.        #ifdef msg_editor_opt
  96.         {
  97.  
  98.          if (usr.bored = 0)
  99.             {
  100.               usr.bored := 1;
  101.               editoption(15, 34, 21, 34, Boolo(usr.bored) , 4, ' ', str_st_data_fields);
  102.               goto getfull;
  103.             }
  104.          if (usr.bored = 1)
  105.            {
  106.               usr.bored := 0;
  107.               editoption(15, 34, 21, 34, Boolo(usr.bored) , 4, ' ', str_st_data_fields);
  108.               goto getfull;
  109.            }
  110.         }
  111.        #else
  112.         {
  113.           optionbad();
  114.          goto start;
  115.         }
  116.        #endif
  117.     }
  118.  
  119.     if (inkeys = "q")  // Quite Mode
  120.      {
  121.         print(str_st_menu_display, 'Q');
  122.         #ifdef quiet_opt
  123.  
  124.          {
  125.             if (usr.notavail = 0)
  126.               {
  127.                 usr.notavail := 1;
  128.                 editoption(18, 34, 21, 34, Bool(usr.notavail) , 4, ' ', str_st_data_fields);
  129.                 goto getfull;
  130.               }
  131.             if (usr.notavail = 1)
  132.               {
  133.                 usr.notavail := 0;
  134.                 editoption(18, 34, 21, 34, Bool(usr.notavail) , 4, ' ', str_st_data_fields);
  135.                 goto getfull;
  136.               }
  137.           }
  138.         #else
  139.          {
  140.           optionbad();
  141.           goto start;
  142.         }
  143.        #endif
  144.      }
  145.  
  146.     if (inkeys = "n")  // ANSI mode
  147.      {
  148.         print(str_st_menu_display, 'N');
  149.        #ifdef ansi_opt
  150.         {
  151.         log(":COOLUSER: "+ str_st_log_ansi);
  152.          if (usr.video = 1)
  153.            {
  154.              usr.video := 0;
  155.              usr.fsr:= 0;
  156.              usr.bored := 1;
  157.              goto start;
  158.            }
  159.  
  160.          if (usr.video = 0)
  161.            {
  162.              usr.video := 1;
  163.              goto start;
  164.            }
  165.          if (usr.video = 3)
  166.            {
  167.              usr.video := 1;
  168.              goto start;
  169.            }
  170.         }
  171.        #else
  172.          {
  173.            optionbad();
  174.            goto start;
  175.          }
  176.        #endif
  177.  
  178.      }
  179.     if (inkeys = "w")  // Full Screen Msg Viewer
  180.      {
  181.       print(str_st_menu_display, 'W');
  182.        #ifdef msg_viewer_opt
  183.        {
  184.        log(":COOLUSER: "+ str_st_log_scn_viewer);
  185.          if (usr.fsr = 0)
  186.            {
  187.              usr.fsr := 1;
  188.              editoption(15, 71, 21, 34, Bool(usr.fsr) , 4, ' ', str_st_data_fields);
  189.              goto getfull;
  190.            }
  191.          if (usr.fsr = 1)
  192.            {
  193.              usr.fsr := 0;
  194.              editoption(15, 71, 21, 34, Bool(usr.fsr) , 4, ' ', str_st_data_fields);
  195.              goto getfull;
  196.            }
  197.        }
  198.        #else
  199.        {
  200.            optionbad();
  201.            goto start;
  202.        }
  203.        #endif
  204.      }
  205.  
  206.     if (inkeys = "g")  // Screen Length
  207.      {
  208.       print(str_st_menu_display, 'G');
  209.       #ifdef scn_length_opt
  210.          {
  211.         log(":COOLUSER: "+ str_st_log_scn_len);
  212. linesno:
  213.            editoption(16, 71, 16, 71, "", 4, '░' , str_st_edit);
  214.            name:=inputuser(2);
  215.            nameint:=strtoi(name);
  216.  
  217.            if (strlen(name) = 0)
  218.             {
  219.               goto start;
  220.             }
  221.  
  222.            if (nameint < 10 or nameint > 66)
  223.              {
  224.               goto linesno;
  225.              }
  226.            usr.len := nameint;
  227.            goto start;
  228.         }
  229.       #else
  230.        {
  231.         optionbad();
  232.         goto start;
  233.        }
  234.       #endif
  235.    }
  236.  
  237.     if (inkeys = "m")  // More Prompt
  238.      {
  239.        print(str_st_menu_display, 'M');
  240.        #ifdef  more_opt
  241.        {
  242.         log(":COOLUSER: "+ str_st_log_more);
  243.         if (usr.more = 0)
  244.            {
  245.              usr.more := 1;
  246.              editoption(17, 71, 21, 34, Bool(usr.more) , 4, ' ', str_st_data_fields);
  247.              goto getfull;
  248.            }
  249.         if (usr.more = 1)
  250.            {
  251.              usr.more := 0;
  252.              editoption(17, 71, 21, 34, Bool(usr.more) , 4, ' ', str_st_data_fields);
  253.              goto getfull;
  254.            }
  255.        }
  256.       #else
  257.        {
  258.         optionbad();
  259.         goto start;
  260.        }
  261.       #endif
  262.      }
  263.  
  264.     if (inkeys = "k")  // Hot Keys
  265.      {
  266.       print(str_st_menu_display, 'K');
  267.       #ifdef hot_opt
  268.        {
  269.         log(":COOLUSER: "+ str_st_log_hot);
  270.         if (usr.hotkeys = 0)
  271.            {
  272.              usr.hotkeys := 1;
  273.              editoption(18, 71, 21, 34, Bool(usr.hotkeys) , 4, ' ', str_st_data_fields);
  274.              goto getfull;
  275.            }
  276.         if (usr.hotkeys = 1)
  277.            {
  278.              usr.hotkeys := 0;
  279.              editoption(18, 71, 21, 34, Bool(usr.hotkeys) , 4, ' ', str_st_data_fields);
  280.              goto getfull;
  281.            }
  282.        }
  283.       #else
  284.        {
  285.         optionbad();
  286.         goto start;
  287.        }
  288.       #endif
  289.      }
  290.     if (inkeys = "a")  // Default Archiver
  291.      {
  292.        print(str_st_menu_display, 'A');
  293.        #ifdef qwk_opt
  294.        {
  295.         log(":COOLUSER: "+ str_st_log_arch);
  296.         pageheader();
  297.         print(str_st_text, "\n" , str_st_qwk, " ... : ",
  298.                 str_st_data_fields, padleft(compressor_num_to_name(usr.compress), 10, ' '), COL_GRAY, '\n');
  299.         menu_cmd(620, "");
  300.         goto start;
  301.       }
  302.       #else
  303.        {
  304.         optionbad();
  305.         goto start;
  306.        }
  307.       #endif
  308.      }
  309.  
  310.     if (inkeys = "z")  // Default Protocol
  311.      {
  312.        print(str_st_menu_display, 'Z');
  313.        #ifdef protocol_opt
  314.        {
  315.          log(":COOLUSER: "+ str_st_log_prot);
  316.          pageheader();
  317.  
  318.          if (intnot = 0)
  319.          {
  320.           display_file(str_st_dir_txt + "cuprot", nonstop);
  321.           do
  322.             {
  323.              inkey:=getch();
  324.  
  325.                if (inkey = 13 or inkey = 'z' or inkey = 'y' or inkey = 'g' or inkey = 'x' or inkey = '1' or inkey = 's' or inkey = 'Z' or inkey = 'Y' or inkey = 'G' or inkey = 'X' or inkey = 'S')
  326.                  {
  327.                    done:=TRUE;
  328.                      if (inkey=13)
  329.                         {
  330.                          print("\n\n", str_st_opt_disable, str_st_not_changed);
  331.                          sleep(1);
  332.                         }
  333.                      if (inkey='z' or inkey = 'Z')
  334.                         {
  335.                          usr.def_proto:= PROTOCOL_ZMODEM ;         // user's default protocol
  336.                         }
  337.                      else if (inkey='y' or inkey = 'Y')
  338.                         {
  339.                           usr.def_proto:= PROTOCOL_YMODEM ;
  340.                         }
  341.                      else if (inkey='g' or inkey = 'G')
  342.                         {
  343.                          usr.def_proto:= PROTOCOL_YMODEMG ;
  344.                         }
  345.                      else if (inkey='x' or inkey = 'X')
  346.                         {
  347.                          usr.def_proto:= PROTOCOL_XMODEM ;
  348.                         }
  349.                      else if (inkey='1')
  350.                         {
  351.                          usr.def_proto:= PROTOCOL_XMODEM1K ;
  352.                         }
  353.                     else if (inkey='s' or inkey = 'S')
  354.                         {
  355.                          usr.def_proto:= PROTOCOL_SEALINK ;
  356.                         }
  357.                  }
  358.                else
  359.                  {
  360.                   done:=FALSE;
  361.                  }
  362.             }
  363.          while (done = FALSE);
  364.          goto start;
  365.          }
  366.         else
  367.         {
  368.           print(str_st_text, "\n" , str_st_protocol, " ... : ",
  369.            str_st_data_fields, padleft(protocol_num_to_name(usr.def_proto),
  370.           10, ' '), COL_GRAY, '\n');
  371.           menu_cmd(618, "");
  372.         }
  373.        }
  374.       #else
  375.        {
  376.         optionbad();
  377.         goto start;
  378.        }
  379.       #endif
  380.       }
  381.  
  382.     if (inkeys = "i") // Location
  383.       {
  384.        print(str_st_menu_display, 'I');
  385.  
  386.        #ifdef location_opt
  387.        {
  388.       log(":COOLUSER: "+ str_st_log_loc);
  389.       editoption(5, 34, 5, 34, "", 20, '░' , str_st_edit);
  390.       name:=inputuser(20
  391.       );
  392.       nameint:=strtoi(name);
  393.  
  394.       if (strlen(name) = 0)
  395.       {
  396.         goto start;
  397.       }
  398.  
  399.        usr.city := name;
  400.        goto start;
  401.       }
  402.       #else
  403.       {
  404.        optionbad();
  405.        goto start;
  406.       }
  407.       #endif
  408.    }
  409.  
  410.     if (inkeys = "v") // Voice/Home Phone
  411.       {
  412.        print(str_st_menu_display, 'V');
  413.         #ifdef voice_opt
  414.          {
  415.          log(":COOLUSER: "+ str_st_log_voice);
  416. voicephone:
  417.        editoption(6, 34, 6, 34, "", 15, '░' , str_st_edit);
  418.        name:= "";
  419.        nameco:=1;
  420.  
  421.        inkey:=getch();
  422.  
  423.        while(inkey<>13) // do this until we get <Enter>
  424.         {
  425.             if(inkey=8)             // if we got a <Backspace>
  426.            {
  427.                if(nameco>1)
  428.               {
  429.                   print("\b░\b");
  430.                   nameco:=nameco-1;
  431.                   name:=substr(name,1,strlen(name)-1);
  432.               }
  433.               else
  434.                   name:="";
  435.           }
  436.           else
  437.           {
  438.                 if(inkey = '0' or inkey = '1' or inkey = '2' or inkey = '3' or inkey = '4' or inkey = '5' or inkey = '6' or inkey = '7' or inkey = '8' or inkey = '9')
  439.                 {
  440.                  print(inkey);
  441.                  name[nameco]:=inkey;
  442.                  nameco:=nameco+1;
  443.                 }
  444.           }
  445.           inkey:=getch();
  446.       }
  447.  
  448.       nameint:=strtoi(name);
  449.  
  450.       if (strlen(name) = 0)
  451.       {
  452.          goto start;
  453.       }
  454.  
  455.       if (strlen(name) < phone_no)
  456.       {
  457.         goto voicephone;
  458.       }
  459.  
  460.        usr.phone := name;
  461.        goto start;
  462.       }
  463.       #else
  464.       {
  465.        optionbad();
  466.        goto start;
  467.       }
  468.      #endif
  469.    }
  470.  
  471.     if (inkeys = "d") // Business/ Data Phone
  472.       {
  473.        print(str_st_menu_display, 'D');
  474.         #ifdef data_opt
  475.          {
  476.          log(":COOLUSER: "+ str_st_log_business);
  477. businessphone:
  478.        editoption(7, 34, 7, 34, "", 15, '░' , str_st_edit);
  479.        name:= "";
  480.        nameco:=1;
  481.  
  482.        inkey:=getch();
  483.  
  484.        while(inkey<>13) // do this until we get <Enter>
  485.         {
  486.             if(inkey=8)             // if we got a <Backspace>
  487.            {
  488.                if(nameco>1)
  489.               {
  490.                   print("\b░\b");
  491.                   nameco:=nameco-1;
  492.                   name:=substr(name,1,strlen(name)-1);
  493.               }
  494.               else
  495.                   name:="";
  496.           }
  497.           else
  498.           {
  499.                 if(inkey = '0' or inkey = '1' or inkey = '2' or inkey = '3' or inkey = '4' or inkey = '5' or inkey = '6' or inkey = '7' or inkey = '8' or inkey = '9')
  500.                 {
  501.                  print(inkey);
  502.                  name[nameco]:=inkey;
  503.                  nameco:=nameco+1;
  504.                 }
  505.           }
  506.           inkey:=getch();
  507.       }
  508.  
  509.       nameint:=strtoi(name);
  510.  
  511.       if (strlen(name) = 0)
  512.       {
  513.          goto start;
  514.       }
  515.  
  516.       if (strlen(name) < phone_no)
  517.       {
  518.         goto businessphone;
  519.       }
  520.  
  521.         usr.dataphone := name;
  522.         goto start;
  523.       }
  524.       #else
  525.       {
  526.        optionbad();
  527.        goto start;
  528.       }
  529.       #endif
  530.    }
  531.  
  532.     if (inkeys = "p")  // Password
  533.      {
  534.        print(str_st_menu_display, 'P');
  535.        #ifdef password_opt
  536.          {
  537.            writefile("cucheck.4");  // Goto menu menu input.
  538.            return;
  539.          }
  540.        #else
  541.          {
  542.          optionbad();
  543.          goto start;
  544.          }
  545.        #endif
  546.     }
  547. goto getfull;
  548.  
  549. start:
  550.  writefile("cucheck.1");  // Display Main Menu
  551.  return;
  552.  
  553. getfull:
  554.  writefile("cucheck.3"); // Display main menu options input first.
  555.  return;
  556.  
  557. }
  558.  
  559.